package lab02.Test19;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        String result;
        Scanner s=new Scanner(System.in);
        result=s.next();
        System.out.println(result);
        char[] c=result.toCharArray();
        StringBuffer b=new StringBuffer();
        for (int i=result.length()-1;i>=0;i--){
            if (c[i]>='A'&&c[i]<='Z'){
                b.append(String.valueOf(c[i]).toLowerCase());
            }else if (c[i]>='a'&&c[i]<='z'){
                b.append(String.valueOf(c[i]).toUpperCase());
            }
        }
        System.out.println(b.toString());
    }
}
